from flask import Flask, url_for
from markupsafe import escape

app = Flask(__name__)

@app.route("/")
def index():
    return 'index'

@app.route("/login")
def login():
    return 'login'

@app.route("/user/<username>")
def profile(username):
    return '{}\'s profile'.format(escape(username))
with app.test_request_context():
    print(url_for('index'))
    print(url_for('login'))
    print(url_for('login', next='/'))
    print(url_for('profile', username='John Doe', a='b'))
    print(url_for('static', filename="index.html"))
    #  /static/index.html

# /
# /login
# /login?next=%2F
# /user/John%20Doe